package com.um.jdy.platform.platform.controller;

import com.um.jdy.common.platform.entity.dto.RentSettingDTO;
import com.um.jdy.common.platform.entity.vo.RentSettingVO;
import com.um.jdy.platform.platform.manager.RentSettingManager;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.orm.controller.BaseController;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 控制器：租借设置
 */
@RestController
@RequestMapping("/api/v1/cms/platform/rent_setting")
@Api(tags = "平台设置", description = "租借设置")
@ApiPermission("rent_setting")
@TokenRequired
public class RentSettingController extends BaseController<RentSettingManager> {

    /**
     * 详情
     *
     * @return
     */
    @ApiPermission("get")
    @ApiOperation("详情")
    @GetMapping
    public Response<RentSettingVO> get() {
        return manager.get();
    }

    /**
     * 更新
     *
     * @param id
     * @param rentSettingDTO
     * @return
     */
    @ApiPermission("update")
    @ApiOperation("更新")
    @PutMapping({"{id}"})
    public Response update(@PathVariable String id, @RequestBody RentSettingDTO rentSettingDTO) {
        return manager.update(id, rentSettingDTO);
    }
}
